#ifndef SWP_REPORT_EDITOR_H
#define SWP_REPORT_EDITOR_H

#include <ieditor.h>

#include <QtGui/QFrame>

QT_BEGIN_NAMESPACE
class QGridLayout;
QT_END_NAMESPACE

namespace swp
{
class ReportData;

class SwpReportEditor : public QFrame, public core::IEditor
{
    Q_OBJECT

public:
    SwpReportEditor(QWidget* parent = 0);
    ~SwpReportEditor();

    // IEditor
    void open(const QSharedPointer<core::IDocument>& document);
    void close(const QSharedPointer<core::IDocument>& document);

    QSharedPointer<core::IDocument> document() const;
    QWidget* widget() const;

    QStringList galleryGroups() const;
    QList<core::GalleryItem> galleryItems(const QString& group) const;

    void registerFocusListener(QObject* object);
    void unregisterFocusListener(QObject* object);

protected:
    IEditor* copy() const;

private:
    void buildReport(QGridLayout* layout);

protected:
    QList<QObject* > m_focusListeners;
    QSharedPointer<core::IDocument> m_document;
    ReportData* m_documentData;
};

} // namespace swp

#endif
